package select;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import neural.Individual;

public class MixUniversal extends Mix{

	public MixUniversal(int eliteSelected){
		super(eliteSelected);
	}
	
	@Override
	public List<Individual> getOthers(List<Individual> selected, List<Individual> individuals, int amount) {
		Universal universal = new Universal(amount);
		Map<Individual,FitnessValues> fitnessMap = new HashMap<Individual,FitnessValues>();
		Double totalFitness = universal.calculateFitness(fitnessMap, individuals);
		universal.calculateFrequencies(fitnessMap, totalFitness, individuals);
		return universal.selectRandomly(fitnessMap, amount, selected);
	}

}
